package com.bmob.lover.ui.fragment.anniversary

import android.view.View
import com.chad.library.adapter.base.BaseQuickAdapter
import com.bmob.lover.R
import com.bmob.lover.data.model.bean.Anniversary
import com.bmob.lover.ui.adapter.AnniversaryAdapter
import com.bmob.lover.ui.fragment.base.BasePagerFragment
import com.bmob.lover.viewmodel.request.AnniversaryRequestViewModel
import com.theone.mvvm.core.data.enum.LayoutManagerType
import com.theone.mvvm.ext.qmui.setTitleWithBackBtn

/**
 * @author The one
 * @date 2021-07-25 20:35
 * @describe 纪念日
 * @email 625805189@qq.com
 * @remark
 */
class AnniversaryFragment:BasePagerFragment<Anniversary,AnniversaryRequestViewModel>() {

    override fun initView(root: View) {
        super.initView(root)
        getTopBar()?.run {
            setTitleWithBackBtn("纪念日",this@AnniversaryFragment)
            addRightImageButton(R.drawable.icon_add_dark,R.id.topbar_right_view).setOnClickListener {
                startFragment(AnniversaryAddFragment())
            }
        }
    }

    override fun createAdapter(): BaseQuickAdapter<Anniversary, *> = AnniversaryAdapter()

    override fun onItemClick(adapter: BaseQuickAdapter<*, *>, view: View, position: Int) {

    }

    override fun getLayoutManagerType(): LayoutManagerType  = LayoutManagerType.GRID

    override fun getItemSpace(): Int = 12

}